<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
<head th:replace="common/common.html::common_css">
</head>
<style>
    p {
        margin-left: 5px;
    }
</style>
<body>
<div th:replace="common/admin_common.html::common_sidebar"></div>
<div class="page">
    <div th:replace="common/admin_common.html::common_navbar"></div>
    <!-- Breadcrumb-->
    <div class="breadcrumb-holder">
        <div class="container-fluid">
            <ul class="breadcrumb">
                <li class="breadcrumb-item"><a th:href="@{/admin/admin_index.html}">主页</a></li>
                <li class="breadcrumb-item"><a th:href="@{/admin/testpaper_manage.html}">试卷管理</a></li>
                <li class="breadcrumb-item active">试卷详情</li>
            </ul>
        </div>
    </div>
    <section>
        <div class="container-fluid">
            <!-- Page Header-->
            <header>
                <h1 class="h3 display">试卷信息</h1>
            </header>
            <div class="row">
                <div class="col-lg-6" style="flex:100%;max-width: 100%">
                    <input type="hidden" name="testpaperid" th:value="${testpaper.testpaperid}">
                    <div class="form-group-material">
                        <input id="testpapername" th:value="${testpaper.testpapername}" type="text"
                               style="background-color: #fff !important;" name="testpapername" required
                               data-msg="请输入试卷名称" class="input-material">
                        <label for="testpapername" class="label-material">试卷名称</label>
                    </div>
                    <div class="form-group-material">
                        <input type="hidden" name="apartmentid" th:value="${testpaper.apartmentid}">
                        <label class="label-material"
                               style="color: #aaaaaa;">部门</label>
                        <p th:text="${testpaper.apartmentname}"></p>
                    </div>
                    <div class="form-group-material">
                        <input type="hidden" name="type" th:value="${testpaper.type}">
                        <label class="label-material"
                               style="color: #aaaaaa;">试卷类型</label>
                        <p th:if="${testpaper.type}">固定组卷</p>
                        <p th:if="${not testpaper.type}">随机组卷</p>
                    </div>
                    <div class="form-group-material">
                        <input type="hidden" name="type" th:value="${testpaper.singlenum}">
                        <label class="label-material"
                               style="color: #aaaaaa;">单选题数目</label>
                        <p th:text="${testpaper.singlenum}"></p>
                    </div>
                    <div class="form-group-material">
                        <input type="hidden" name="type" th:value="${testpaper.multiplenum}">
                        <label class="label-material"
                               style="color: #aaaaaa;">多选题数目</label>
                        <p th:text="${testpaper.multiplenum}"></p>
                    </div>
                    <div class="form-group-material">
                        <input type="hidden" name="type" th:value="${testpaper.judgenum}">
                        <label class="label-material"
                               style="color: #aaaaaa;">判断题数目</label>
                        <p th:text="${testpaper.judgenum}"></p>
                    </div>
                    <div class="form-group-material">
                        <input type="hidden" name="type" th:value="${testpaper.totalpoint}">
                        <label class="label-material"
                               style="color: #aaaaaa;">试卷总分</label>
                        <p th:text="${testpaper.totalpoint}"></p>
                    </div>
                    <th:block th:if="${testpaper.status==2}">
                        <div class="form-group-material">
                            <input type="hidden" name="status" th:value="${testpaper.status}">
                            <label class="label-material"
                                   style="color: #aaaaaa;">状态</label>
                            <th:block
                                    th:if="${testpaper.status==2 and testpaper.starttime != null and testpaper.endtime != null}">
                                <p th:if="${#dates.createNow().before(testpaper.starttime)}" style="color: deepskyblue">
                                    审核通过，即将开考</p>
                                <p th:if="${#dates.createNow().after(testpaper.starttime) and  #dates.createNow().before(testpaper.endtime)}"
                                   style="color: limegreen">正在考试</p>
                                <p th:if="${#dates.createNow().after(testpaper.endtime)}" style="color: #aaaaaa">
                                    考试已结束</p>
                            </th:block>
                            <p th:if="${testpaper.status==3}" style="color: red">审核未通过</p>
                            <p th:if="${testpaper.status==1 and testpaper.starttime == null and testpaper.endtime == null}"
                               style="color: orange">待审核</p>
                        </div>
                        <div class="form-group-material">
                            <input type="hidden" name="starttime" th:value="${testpaper.starttime}">
                            <label class="label-material"
                                   style="color: #aaaaaa;">开始时间</label>
                            <p style="color: deepskyblue"
                               th:text="${#dates.format(testpaper.starttime,'yyyy-MM-dd HH:mm')}"></p>
                        </div>
                        <div class="form-group-material">
                            <input type="hidden" name="endtime" th:value="${testpaper.endtime}">
                            <label class="label-material"
                                   style="color: #aaaaaa;">截止时间</label>
                            <p style="color: deepskyblue"
                               th:text="${#dates.format(testpaper.endtime,'yyyy-MM-dd HH:mm')}"></p>
                        </div>
                        <div class="form-group-material">
                            <input type="hidden" name="timelimt" th:value="${testpaper.timelimt}">
                            <label class="label-material"
                                   style="color: #aaaaaa;">考试时长</label>
                            <p style="color: deepskyblue" th:text="${testpaper.timelimt}+'分钟'"></p>
                        </div>
                    </th:block>
                    <th:block th:if="${testpaper.status==1}">
                        <div class="form-group-material">
                            <input type="hidden" name="status" th:value="${testpaper.status}">
                            <label class="label-material"
                                   style="color: #aaaaaa;">状态</label>
                            <p style="color: orange">待审核</p>
                        </div>
                    </th:block>
                    <th:block th:if="${testpaper.status==3}">
                        <div class="form-group-material">
                            <input type="hidden" name="status" th:value="${testpaper.status}">
                            <label class="label-material"
                                   style="color: #aaaaaa;">状态</label>
                            <p style="color: red">审核未通过</p>
                        </div>
                    </th:block>
                    <th:block th:if="${testpaper.type}">
                        <div class="form-group-material">
                            <input type="hidden" name="type" th:value="${testpaper.totalpoint}">
                            <h4 class="label-material"
                                style="color: #aaaaaa;">试卷内容</h4>
                            <table class="table">
                                <tbody>
                                <th:block th:if="${Squestions.size() != 0}">
                                    <tr>
                                        <td>
                                            <h5 class="label-material">单 选 题</h5>
                                        </td>
                                    </tr>
                                    <tr th:each="question:${Squestions}">
                                        <td>
                                            <div class="form-group-material">
                                                <label class="label-material" th:text="${question.content}"></label>
                                                <p th:if="${(question.optionA!= null and (not question.optionA.equals('')))}">
                                                    A <span th:text="${question.optionA}"></span></p>
                                                <p th:if="${(question.optionB!= null and (not question.optionB.equals('')))}">
                                                    B <span th:text="${question.optionB}"></span></p>
                                                <p th:if="${(question.optionC!= null and (not question.optionC.equals('')))}">
                                                    C <span th:text="${question.optionC}"></span></p>
                                                <p th:if="${(question.optionD!= null and (not question.optionD.equals('')))}">
                                                    D <span th:text="${question.optionD}"></span></p>
                                                <p th:if="${(question.optionE!= null and (not question.optionE.equals('')))}">
                                                    E <span th:text="${question.optionE}"></span></p>
                                                <p th:if="${(question.optionF!= null and (not question.optionF.equals('')))}">
                                                    F <span th:text="${question.optionF}"></span></p>
                                            </div>
                                            <div class="form-group-material">
                                                <p th:text="'答案: '+${question.answer}"></p>
                                            </div>
                                        </td>
                                    </tr>
                                </th:block>
                                <th:block th:if="${Mquestions.size() != 0}">
                                    <tr>
                                        <td>
                                            <h5 class="label-material">多 选 题</h5>
                                        </td>
                                    </tr>
                                    <tr th:each="question:${Mquestions}">
                                        <td>
                                            <div class="form-group-material">
                                                <label class="label-material" th:text="${question.content}"></label>
                                                <p th:if="${(question.optionA!= null and (not question.optionA.equals('')))}">
                                                    A <span th:text="${question.optionA}"></span></p>
                                                <p th:if="${(question.optionB!= null and (not question.optionB.equals('')))}">
                                                    B <span th:text="${question.optionB}"></span></p>
                                                <p th:if="${(question.optionC!= null and (not question.optionC.equals('')))}">
                                                    C <span th:text="${question.optionC}"></span></p>
                                                <p th:if="${(question.optionD!= null and (not question.optionD.equals('')))}">
                                                    D <span th:text="${question.optionD}"></span></p>
                                                <p th:if="${(question.optionE!= null and (not question.optionE.equals('')))}">
                                                    E <span th:text="${question.optionE}"></span></p>
                                                <p th:if="${(question.optionF!= null and (not question.optionF.equals('')))}">
                                                    F <span th:text="${question.optionF}"></span></p>
                                            </div>
                                            <div class="form-group-material">
                                                <p th:text="'答案: '+${question.answer}"></p>
                                            </div>
                                        </td>
                                    </tr>
                                </th:block>
                                <th:block th:if="${Jquestions.size()!=0}">
                                    <tr>
                                        <td>
                                            <h5 class="label-material">判 断 题</h5>
                                        </td>
                                    </tr>
                                    <tr th:each="question:${Jquestions}">
                                        <td>
                                            <div class="form-group-material">
                                                <label class="label-material" th:text="${question.content}"></label>
                                                <p th:if="${question.judgeanswer}">答案: 正 确</p>
                                                <p th:if="${not question.judgeanswer}">答案: 错 误</p>
                                            </div>
                                        </td>
                                    </tr>
                                </th:block>
                                </tbody>
                            </table>
                        </div>
                    </th:block>
                    <div class="form-group text-center">
                        <a th:href="@{/admin/testpaper_manage.html}"
                           type="button" class="btn btn-warning m-b-10 m-1-5"
                           style="border-radius: 4px;margin-left: 50px">返回</a>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <div th:replace="common/common.html::common_footer"></div>
</div>
<div th:replace="common/common.html::common_js">
</div>
</body>
</html>